﻿using NExt.Core.Model.Base;

namespace NExt.form
{
    public class Field: Field<FieldEvents>
    {
    }

    public abstract class Field<TEvents>: BoxComponent<TEvents>
        where TEvents: BoxComponentEvents, new()
    {
        public object autoCreate { get; set; }
        public string dataMember { get; set; }
        public string fieldClass { get; set; }
        public string focusClass { get; set; }
        public string inputType { get; set; }
        public string invalidClass { get; set; }
        public string invalidText { get; set; }
        public string msgFx { get; set; }
        public string msgTarget { get; set; }
        public string name { get; set; }
        public bool? readOnly { get; set; }
        public int? tabIndex { get; set; }
        public bool?  validateOnBlur  { get; set; }
        public int? validationDelay { get; set; }
        public object validationEvent { get; set; }
        public object value { get; set; }
    }

    public class FieldEvents: BoxComponentEvents
    {
        public IScript blur { get; set; }
        public IScript change { get; set; }
        public IScript focus { get; set; }
        public IScript invalid { get; set; }
        public IScript specialkey { get; set; }
        public IScript valid { get; set; }
    }
}
